package org.whz.factory;

import org.whz.entity.Commodity;

public  class CommodityFactory {
    public static   <T extends Commodity> T create(Class<T> c){
        Commodity commodity = null;
        try{
            commodity = (Commodity) Class.forName(c.getName()).newInstance();
        }catch (Exception e){
            System.out.println("工厂生产异常");
        }
        return (T)commodity;
    }
}
